NIK and RRPlots

The libraries

library(survival)
library(FRESA.CAD)
## Loading required package: Rcpp
## Loading required package: stringr
## Loading required package: miscTools
## Loading required package: Hmisc
## 
## Attaching package: 'Hmisc'
## The following objects are masked from 'package:base':
## 
##     format.pval, units
## Loading required package: pROC
## Type 'citation("pROC")' for a citation.
## 
## Attaching package: 'pROC'
## The following objects are masked from 'package:stats':
## 
##     cov, smooth, var
library(Biobase)
## Loading required package: BiocGenerics
## 
## Attaching package: 'BiocGenerics'
## The following object is masked from 'package:pROC':
## 
##     var
## The following objects are masked from 'package:stats':
## 
##     IQR, mad, sd, var, xtabs
## The following objects are masked from 'package:base':
## 
##     anyDuplicated, append, as.data.frame, basename, cbind, colnames,
##     dirname, do.call, duplicated, eval, evalq, Filter, Find, get, grep,
##     grepl, intersect, is.unsorted, lapply, Map, mapply, match, mget,
##     order, paste, pmax, pmax.int, pmin, pmin.int, Position, rank,
##     rbind, Reduce, rownames, sapply, setdiff, sort, table, tapply,
##     union, unique, unsplit, which.max, which.min
## Welcome to Bioconductor
## 
##     Vignettes contain introductory material; view with
##     'browseVignettes()'. To cite Bioconductor, see
##     'citation("Biobase")', and for packages 'citation("pkgname")'.
## 
## Attaching package: 'Biobase'
## The following object is masked from 'package:Hmisc':
## 
##     contents
## The following object is masked from 'package:miscTools':
## 
##     rowMedians
op <- par(no.readonly = TRUE)
pander::panderOptions('digits', 3)
pander::panderOptions('table.split.table', 400)
pander::panderOptions('keep.trailing.zeros',TRUE)
if (!require("BiocManager", quietly = TRUE))
{
    install.packages("BiocManager")
    BiocManager::install("seventyGeneData")
}
## Bioconductor version '3.15' is out-of-date; the current release version '3.17'
##   is available with R version '4.3'; see https://bioconductor.org/install
library(seventyGeneData)
data(vanDeVijver)
class(vanDeVijver)
## [1] "ExpressionSet"
## attr(,"package")
## [1] "Biobase"

Getting the clinical data

pdata <- pData(vanDeVijver)

ROC Plots

table(pdata$Posnodes)

n y 151 144

pander::pander(table(pdata$TTMevent))
0 1
194 101
pmroc <- plotModels.ROC(cbind(pdata$TTMevent,-pdata$C1used),name="NIK",thr= -0.4) ## Using paper threshold

par(op)

RR Plot Signature correlation

rdata <- cbind(pdata$TTMevent,pdata$C1used)


RRAnalysisCI <- RRPlot(rdata,atRate=c(0.10,0.05),
                     timetoEvent=pdata$RFS,
                     title="Signature: Breast Cancer",
                     ysurvlim=c(0.00,1.0))

par(op)

CI Performance all data

pander::pander(t(RRAnalysisCI$keyPoints),caption="Threshold values")
Threshold values
  @:0.1 @:0.05 @MAX_BACC @MAX_RR @SPE100
Thr 0.519 0.619 0.465 0.623 7.56e-01
RR 3.806 3.548 4.160 5.069 3.91e+01
RR_LCI 2.082 1.642 2.391 1.954 8.17e-02
RR_UCI 6.957 7.666 7.237 13.150 1.87e+04
SEN 0.901 0.941 0.881 0.960 1.00e+00
SPE 0.397 0.247 0.485 0.242 5.67e-02
BACC 0.649 0.594 0.683 0.601 5.28e-01
pander::pander(RRAnalysisCI$c.index$cstatCI,caption="C. Index")
mean.C Index median lower upper
0.698 0.698 0.653 0.743
pander::pander(t(RRAnalysisCI$ROCAnalysis$aucs),caption="ROC AUC")
ROC AUC
est lower upper
0.692 0.631 0.752
pander::pander((RRAnalysisCI$ROCAnalysis$sensitivity),caption="Sensitivity")
Sensitivity
est lower upper
0.891 0.813 0.944
pander::pander((RRAnalysisCI$ROCAnalysis$specificity),caption="Specificity")
Specificity
est lower upper
0.397 0.328 0.469
pander::pander(t(RRAnalysisCI$thr_atP),caption="Probability Thresholds")
Probability Thresholds
10% 5%
0.517 0.618
pander::pander(RRAnalysisCI$surdif,caption="Logrank test")
Logrank test Chisq = 28.085735 on 2 degrees of freedom, p = 0.000001
  N Observed Expected (O-E)^2/E (O-E)^2/V
class=0 55 6 23.5 13.01 17.1
class=1 33 5 12.9 4.87 5.6
class=2 207 90 64.6 10.00 27.9

Node positive data

RR Plot Signature correlation

NodePdata <- subset(pdata,Posnodes=="y")

rdata <- cbind(NodePdata$TTMevent,NodePdata$C1used)


RRAnalysisPos <- RRPlot(rdata,atRate=c(0.90,0.95),
                     timetoEvent=NodePdata$RFS,
                     title="Signature: Breast Cancer",
                     ysurvlim=c(0.00,1.0))

par(op)

CI Performance positive data

pander::pander(t(RRAnalysisPos$keyPoints),caption="Threshold values")
Threshold values
  @:0.9 @:0.95 @MAX_BACC @MAX_RR @SPE100
Thr 0.486 0.655 0.267 0.486 7.17e-01
RR 3.231 1.579 3.083 3.231 1.34e+01
RR_LCI 1.377 0.563 1.746 1.377 2.94e-02
RR_UCI 7.578 4.431 5.444 7.578 6.14e+03
SEN 0.894 0.936 0.745 0.894 1.00e+00
SPE 0.361 0.113 0.639 0.361 4.12e-02
BACC 0.627 0.525 0.692 0.627 5.21e-01
pander::pander(RRAnalysisPos$c.index$cstatCI,caption="C. Index")
mean.C Index median lower upper
0.7 0.699 0.624 0.77
pander::pander(t(RRAnalysisPos$ROCAnalysis$aucs),caption="ROC AUC")
ROC AUC
est lower upper
0.669 0.576 0.761
pander::pander((RRAnalysisPos$ROCAnalysis$sensitivity),caption="Sensitivity")
Sensitivity
est lower upper
0.894 0.769 0.965
pander::pander((RRAnalysisPos$ROCAnalysis$specificity),caption="Specificity")
Specificity
est lower upper
0.371 0.275 0.475
pander::pander(t(RRAnalysisPos$thr_atP),caption="Probability Thresholds")
Probability Thresholds
10% 5%
0.484 0.651
pander::pander(RRAnalysisPos$surdif,caption="Logrank test")
Logrank test Chisq = 11.060876 on 2 degrees of freedom, p = 0.003964
  N Observed Expected (O-E)^2/E (O-E)^2/V
class=0 15 3 5.80 1.35 1.55
class=1 26 2 9.73 6.14 7.77
class=2 103 42 31.47 3.52 10.71

Node Negative data

RR Plot Signature correlation

NodeNdata <- subset(pdata,Posnodes=="n")

rdata <- cbind(NodeNdata$TTMevent,NodeNdata$C1used)


RRAnalysisNeg <- RRPlot(rdata,atRate=c(0.90,0.95),
                     timetoEvent=NodeNdata$RFS,
                     title="Signature: Breast Cancer",
                     ysurvlim=c(0.00,1.0))

par(op)

CI Performance negative data

pander::pander(t(RRAnalysisNeg$keyPoints),caption="Threshold values")
Threshold values
  @:0.9 @:0.95 @MAX_BACC @MAX_RR @SPE100
Thr 0.507 0.585 0.465 0.623 7.56e-01
RR 4.454 5.920 5.130 15.402 3.42e+01
RR_LCI 2.040 1.959 2.344 2.211 7.18e-02
RR_UCI 9.723 17.889 11.228 107.305 1.63e+04
SEN 0.889 0.944 0.889 0.981 1.00e+00
SPE 0.495 0.371 0.546 0.340 9.28e-02
BACC 0.692 0.658 0.718 0.661 5.46e-01
pander::pander(RRAnalysisNeg$c.index$cstatCI,caption="C. Index")
mean.C Index median lower upper
0.695 0.696 0.63 0.766
pander::pander(t(RRAnalysisNeg$ROCAnalysis$aucs),caption="ROC AUC")
ROC AUC
est lower upper
0.709 0.627 0.791
pander::pander((RRAnalysisNeg$ROCAnalysis$sensitivity),caption="Sensitivity")
Sensitivity
est lower upper
0.889 0.774 0.958
pander::pander((RRAnalysisNeg$ROCAnalysis$specificity),caption="Specificity")
Specificity
est lower upper
0.495 0.392 0.598
pander::pander(t(RRAnalysisNeg$thr_atP),caption="Probability Thresholds")
Probability Thresholds
10% 5%
0.513 0.583
pander::pander(RRAnalysisNeg$surdif,caption="Logrank test")
Logrank test Chisq = 24.223875 on 2 degrees of freedom, p = 0.000005
  N Observed Expected (O-E)^2/E (O-E)^2/V
class=0 40 3 18.18 12.67 19.29
class=1 14 3 5.43 1.09 1.21
class=2 97 48 30.39 10.21 23.58

RRPlot Cox Model

timeinterval <- 5 # Five years

h0 <- sum(pdata$TTMevent & pdata$RFS <= timeinterval)
h0 <- h0/sum((pdata$RFS > timeinterval) | (pdata$TTMevent==1))

mcox <- coxph(Surv(RFS,TTMevent)~C1used,pdata)
pander::pander(summary(mcox)$coefficients)
  coef exp(coef) se(coef) z Pr(>|z|)
C1used -1.5 0.224 0.263 -5.69 1.3e-08
index <- predict(mcox,pdata)
rdata <- cbind(pdata$TTMevent,ppoisGzero(index,h0))


RRAnalysisCox <- RRPlot(rdata,atRate=c(0.90,0.95),
                     timetoEvent=pdata$RFS,
                     title="NIK: Breast Cancer",
                     ysurvlim=c(0.00,1.0),
                     riskTimeInterval=timeinterval)

par(op)

Expected time to event

toinclude <- rdata[,1]==1 
obstiemToEvent <- pdata[,"RFS"]
tmin <- 0.1 + min(obstiemToEvent)
tmax <-max(obstiemToEvent)
sum(toinclude)

[1] 101

timetoEvent <- meanTimeToEvent(rdata[,2],timeinterval)
timetoEvent[timetoEvent > 2.0*tmax] <- tmax
lnotime <- log(obstiemToEvent[toinclude])
lnetime <- log(timetoEvent[toinclude])
lmfit <- lm(lnotime~0+lnetime)

sm <- summary(lmfit)
pander::pander(sm)
  Estimate Std. Error t value Pr(>|t|)
lnetime 0.518 0.0375 13.8 6.07e-25
Fitting linear model: lnotime ~ 0 + lnetime
Observations Residual Std. Error \(R^2\) Adjusted \(R^2\)
101 0.755 0.657 0.653
plot(timetoEvent,obstiemToEvent,
     col=1+rdata[,1],
     xlab="Expected time",
     ylab="Observed time",
     main="Expected vs. Observed",
     xlim=c(tmin,tmax),
     ylim=c(tmin,tmax),
     log="xy")
lines(x=c(tmin,tmax),y=lmfit$coefficients*c(tmin,tmax),lty=1,col="blue")
txt <- bquote(paste(R^2 == .(round(sm$r.squared,3))))
text(tmin+0.005*(tmax-tmin),tmax,txt,cex=0.7)
text(tmin+0.015*(tmax-tmin),tmax,sprintf("Slope=%4.3f",sm$coefficients[1]),cex=0.7)
legend("bottomright",legend=c("No Event","Event","Linear fit"),
             pch=c(1,1,-1),
             col=c(1,2,"blue"),
             lty=c(-1,-1,1)
             )

MADerror2 <- mean(abs(timetoEvent[toinclude]-obstiemToEvent[toinclude]))
pander::pander(MADerror2)

4.75

Unadjusted Cox Performance

pander::pander(t(RRAnalysisCox$keyPoints),caption="Threshold values")
Threshold values
  @:0.9 @:0.95 @MAX_BACC @MAX_RR @SPE100 p(0.5)
Thr 0.176 0.154 0.190 0.153 1.27e-01 0.5041
RR 3.806 3.548 4.160 5.069 3.91e+01 0.9241
RR_LCI 2.082 1.642 2.391 1.954 8.17e-02 0.4906
RR_UCI 6.957 7.666 7.237 13.150 1.87e+04 1.7407
SEN 0.901 0.941 0.881 0.960 1.00e+00 0.0693
SPE 0.397 0.247 0.485 0.242 5.67e-02 0.9227
BACC 0.649 0.594 0.683 0.601 5.28e-01 0.4960
NetBenefit 0.223 0.232 0.222 0.239 2.52e-01 -0.0279
pander::pander(t(RRAnalysisCox$OERatio$estimate),caption="O/E Ratio")
O/E Ratio
O/E Low Upper p.value
0.806 0.656 0.979 0.0285
pander::pander(t(RRAnalysisCox$OE95ci),caption="O/E Mean")
O/E Mean
mean 50% 2.5% 97.5%
0.952 0.953 0.924 0.98
pander::pander(t(RRAnalysisCox$OAcum95ci),caption="O/Acum Mean")
O/Acum Mean
mean 50% 2.5% 97.5%
1.15 1.15 1.14 1.17
pander::pander(RRAnalysisCox$c.index$cstatCI,caption="C. Index")
mean.C Index median lower upper
0.698 0.698 0.651 0.745
pander::pander(t(RRAnalysisCox$ROCAnalysis$aucs),caption="ROC AUC")
ROC AUC
est lower upper
0.692 0.631 0.752
pander::pander((RRAnalysisCox$ROCAnalysis$sensitivity),caption="Sensitivity")
Sensitivity
est lower upper
0.891 0.813 0.944
pander::pander((RRAnalysisCox$ROCAnalysis$specificity),caption="Specificity")
Specificity
est lower upper
0.397 0.328 0.469
pander::pander(t(RRAnalysisCox$thr_atP),caption="Probability Thresholds")
Probability Thresholds
10% 5%
0.177 0.154
pander::pander(RRAnalysisCox$surdif,caption="Logrank test")
Logrank test Chisq = 28.085735 on 2 degrees of freedom, p = 0.000001
  N Observed Expected (O-E)^2/E (O-E)^2/V
class=0 55 6 23.5 13.01 17.1
class=1 33 5 12.9 4.87 5.6
class=2 207 90 64.6 10.00 27.9

RRPlot Cox Adjusted Model

This time we will include Lymph node status from pathology report and Estrogen receptor alpha expression measurement from microarray

mcox <- coxph(Surv(RFS,TTMevent)~C1used*(ESR1 + Posnodes),pdata)
pander::pander(summary(mcox)$coefficients)
  coef exp(coef) se(coef) z Pr(>|z|)
C1used -0.403 0.668 0.629 -0.640 0.52186
ESR1 0.123 1.131 0.255 0.481 0.63079
Posnodesy -0.305 0.737 0.217 -1.401 0.16112
C1used:ESR1 -1.913 0.148 0.739 -2.588 0.00966
C1used:Posnodesy 0.378 1.460 0.583 0.649 0.51661
index <- predict(mcox,pdata)
rdata <- cbind(pdata$TTMevent,ppoisGzero(index,h0))


RRAnalysisAdCox <- RRPlot(rdata,atRate=c(0.90,0.95),
                     timetoEvent=pdata$RFS,
                     title="Adjusted: Breast Cancer",
                     ysurvlim=c(0.00,1.0),
                     riskTimeInterval=timeinterval)

par(op)

Expected time to event

timetoEvent <- meanTimeToEvent(rdata[,2],timeinterval)
timetoEvent[timetoEvent > 2.0*tmax] <- tmax
lnotime <- log(obstiemToEvent[toinclude])
lnetime <- log(timetoEvent[toinclude])
lmfit <- lm(lnotime~0+lnetime)
sm <- summary(lmfit)
pander::pander(sm)
  Estimate Std. Error t value Pr(>|t|)
lnetime 0.516 0.0377 13.7 1.29e-24
Fitting linear model: lnotime ~ 0 + lnetime
Observations Residual Std. Error \(R^2\) Adjusted \(R^2\)
101 0.761 0.651 0.648
timetoEvent <- meanTimeToEvent(rdata[,2],timeinterval)


plot(timetoEvent,obstiemToEvent,
     col=1+rdata[,1],
     xlab="Expected time",
     ylab="Observed time",
     main="Expected vs. Observed",
     xlim=c(tmin,tmax),
     ylim=c(tmin,tmax),
     log="xy")
lines(x=c(tmin,tmax),y=lmfit$coefficients*c(tmin,tmax),lty=1,col="blue")
txt <- bquote(paste(R^2 == .(round(sm$r.squared,3))))
text(tmin+0.005*(tmax-tmin),tmax,txt,cex=0.7)
text(tmin+0.015*(tmax-tmin),tmax,sprintf("Slope=%4.3f",sm$coefficients[1]),cex=0.7)
legend("bottomright",legend=c("No Event","Event","Linear fit"),
             pch=c(1,1,-1),
             col=c(1,2,"blue"),
             lty=c(-1,-1,1)
             )

MADerror2 <-c(MADerror2,mean(abs(timetoEvent[toinclude]-obstiemToEvent[toinclude])))
pander::pander(MADerror2)

4.75 and 5.02

Adjusted Cox Performance

pander::pander(t(RRAnalysisAdCox$keyPoints),caption="Threshold values")
Threshold values
  @:0.9 @:0.95 @MAX_BACC @MAX_RR @SPE100 p(0.5)
Thr 0.159 0.133 0.205 0.133 9.92e-02 0.50740
RR 3.422 4.043 3.235 4.699 3.54e+01 1.72657
RR_LCI 1.928 1.863 2.100 2.004 7.42e-02 1.06501
RR_UCI 6.075 8.773 4.984 11.015 1.69e+04 2.79908
SEN 0.891 0.941 0.802 0.950 1.00e+00 0.07921
SPE 0.392 0.278 0.572 0.273 5.15e-02 0.96907
BACC 0.641 0.609 0.687 0.612 5.26e-01 0.52414
NetBenefit 0.230 0.249 0.202 0.252 2.74e-01 0.00617
pander::pander(t(RRAnalysisAdCox$OERatio$estimate),caption="O/E Ratio")
O/E Ratio
O/E Low Upper p.value
0.825 0.672 1 0.0519
pander::pander(t(RRAnalysisAdCox$OE95ci),caption="O/E Mean")
O/E Mean
mean 50% 2.5% 97.5%
0.973 0.973 0.946 0.997
pander::pander(t(RRAnalysisAdCox$OAcum95ci),caption="O/Acum Mean")
O/Acum Mean
mean 50% 2.5% 97.5%
1.18 1.18 1.17 1.19
pander::pander(RRAnalysisAdCox$c.index$cstatCI,caption="C. Index")
mean.C Index median lower upper
0.707 0.706 0.658 0.748
pander::pander(t(RRAnalysisAdCox$ROCAnalysis$aucs),caption="ROC AUC")
ROC AUC
est lower upper
0.702 0.642 0.763
pander::pander((RRAnalysisAdCox$ROCAnalysis$sensitivity),caption="Sensitivity")
Sensitivity
est lower upper
0.891 0.813 0.944
pander::pander((RRAnalysisAdCox$ROCAnalysis$specificity),caption="Specificity")
Specificity
est lower upper
0.397 0.328 0.469
pander::pander(t(RRAnalysisAdCox$thr_atP),caption="Probability Thresholds")
Probability Thresholds
10% 5%
0.159 0.133
pander::pander(RRAnalysisAdCox$surdif,caption="Logrank test")
Logrank test Chisq = 28.504862 on 2 degrees of freedom, p = 0.000001
  N Observed Expected (O-E)^2/E (O-E)^2/V
class=0 60 6 25.3 14.73 19.76
class=1 28 5 11.2 3.45 3.89
class=2 207 90 64.5 10.11 28.16

Calibrating the index

calprob <- CoxRiskCalibration(mcox,pdata,"TTMevent","RFS")
pander::pander(c(h0=calprob$h0,
                 Gain=calprob$hazardGain,
                 DeltaTime=calprob$timeInterval),
               caption="Cox Calibration Parameters")
h0 Gain DeltaTime
0.421 1.04 7.45
h0 <- calprob$h0
timeinterval <- calprob$timeInterval;

rdata <- cbind(pdata$TTMevent,calprob$prob)


RRAnalysisCalAdCox <- RRPlot(rdata,atRate=c(0.90,0.95),
                     timetoEvent=pdata$RFS,
                     title="Cal. NIK: Breast Cancer",
                     ysurvlim=c(0.00,1.0),
                     riskTimeInterval=timeinterval)

par(op)

Expected time to event

timetoEvent <- meanTimeToEvent(rdata[,2],timeinterval)
timetoEvent[timetoEvent > 2.0*tmax] <- tmax
lnetime <- log(timetoEvent[toinclude])
lmfit <- lm(lnotime~0+lnetime)
sm <- summary(lmfit)
sm <- summary(lmfit)
pander::pander(sm)
  Estimate Std. Error t value Pr(>|t|)
lnetime 0.512 0.0374 13.7 1.29e-24
Fitting linear model: lnotime ~ 0 + lnetime
Observations Residual Std. Error \(R^2\) Adjusted \(R^2\)
101 0.761 0.651 0.648
plot(timetoEvent,obstiemToEvent,
     col=1+rdata[,1],
     xlab="Expected time",
     ylab="Observed time",
     main="Expected vs. Observed",
     xlim=c(tmin,tmax),
     ylim=c(tmin,tmax),
     log="xy")
lines(x=c(tmin,tmax),y=lmfit$coefficients*c(tmin,tmax),lty=1,col="blue")
txt <- bquote(paste(R^2 == .(round(sm$r.squared,3))))
text(tmin+0.005*(tmax-tmin),tmax,txt,cex=0.7)
text(tmin+0.015*(tmax-tmin),tmax,sprintf("Slope=%4.3f",sm$coefficients[1]),cex=0.7)
legend("bottomright",legend=c("No Event","Event","Linear fit"),
             pch=c(1,1,-1),
             col=c(1,2,"blue"),
             lty=c(-1,-1,1)
             )

MADerror2 <-c(MADerror2,mean(abs(timetoEvent[toinclude]-obstiemToEvent[toinclude])))
pander::pander(MADerror2)

4.75, 5.02 and 5.13

Calibrated and Adjusted Cox Performance

pander::pander(t(RRAnalysisCalAdCox$keyPoints),caption="Threshold values")
Threshold values
  @:0.9 @:0.95 @MAX_BACC @MAX_RR @SPE100 p(0.5)
Thr 0.224 0.189 0.285 0.188 1.42e-01 0.4924
RR 3.422 4.043 3.235 4.699 3.54e+01 1.8140
RR_LCI 1.928 1.863 2.100 2.004 7.42e-02 1.3369
RR_UCI 6.075 8.773 4.984 11.015 1.69e+04 2.4614
SEN 0.891 0.941 0.802 0.950 1.00e+00 0.3564
SPE 0.392 0.278 0.572 0.273 5.15e-02 0.8299
BACC 0.641 0.609 0.687 0.612 5.26e-01 0.5932
NetBenefit 0.190 0.211 0.162 0.215 2.39e-01 0.0135
pander::pander(t(RRAnalysisCalAdCox$OERatio$estimate),caption="O/E Ratio")
O/E Ratio
O/E Low Upper p.value
0.839 0.683 1.02 0.0831
pander::pander(t(RRAnalysisCalAdCox$OE95ci),caption="O/E Mean")
O/E Mean
mean 50% 2.5% 97.5%
0.99 0.991 0.962 1.02
pander::pander(t(RRAnalysisCalAdCox$OAcum95ci),caption="O/Acum Mean")
O/Acum Mean
mean 50% 2.5% 97.5%
1 1 0.993 1.01
pander::pander(RRAnalysisCalAdCox$c.index$cstatCI,caption="C. Index")
mean.C Index median lower upper
0.707 0.706 0.657 0.751
pander::pander(t(RRAnalysisCalAdCox$ROCAnalysis$aucs),caption="ROC AUC")
ROC AUC
est lower upper
0.702 0.642 0.763
pander::pander((RRAnalysisCalAdCox$ROCAnalysis$sensitivity),caption="Sensitivity")
Sensitivity
est lower upper
0.891 0.813 0.944
pander::pander((RRAnalysisCalAdCox$ROCAnalysis$specificity),caption="Specificity")
Specificity
est lower upper
0.397 0.328 0.469
pander::pander(t(RRAnalysisCalAdCox$thr_atP),caption="Probability Thresholds")
Probability Thresholds
10% 5%
0.224 0.189
pander::pander(RRAnalysisCalAdCox$surdif,caption="Logrank test")
Logrank test Chisq = 28.504862 on 2 degrees of freedom, p = 0.000001
  N Observed Expected (O-E)^2/E (O-E)^2/V
class=0 60 6 25.3 14.73 19.76
class=1 28 5 11.2 3.45 3.89
class=2 207 90 64.5 10.11 28.16

Comparing Risks

Comparing concordance Index

## Correlation Index
cindex <- RRAnalysisCI$c.index$cstatCI
## Cox Index
cindex <- rbind(cindex,RRAnalysisCox$c.index$cstatCI)
## Adjusted Cox Index
cindex <- rbind(cindex,RRAnalysisAdCox$c.index$cstatCI)
## Adjusted and Calibrated Cox Index
cindex <- rbind(cindex,RRAnalysisCalAdCox$c.index$cstatCI)
rownames(cindex) <- c("CI","Cox","Adj. Cox","Cal. Adj. Cox")

pander::pander(cindex)
  mean.C Index median lower upper
CI 0.698 0.698 0.653 0.743
Cox 0.698 0.698 0.651 0.745
Adj. Cox 0.707 0.706 0.658 0.748
Cal. Adj. Cox 0.707 0.706 0.657 0.751

Comparing Risk Ratios Index

## Correlation Index
RRratio <- c(RR=RRAnalysisCI$keyPoints$RR[1],
             LCI=RRAnalysisCI$keyPoints$RR_LCI[1],
             UCI=RRAnalysisCI$keyPoints$RR_UCI[1])
## Cox Index
RRratio <- rbind(RRratio,c(RR=RRAnalysisCox$keyPoints$RR[1],
                           LCI=RRAnalysisCox$keyPoints$RR_LCI[1],
                           UCI=RRAnalysisCox$keyPoints$RR_UCI[1]))
## Adjusted Cox Index
RRratio <- rbind(RRratio,c(RR=RRAnalysisAdCox$keyPoints$RR[1],
                           LCI=RRAnalysisAdCox$keyPoints$RR_LCI[1],
                           UCI=RRAnalysisAdCox$keyPoints$RR_UCI[1]))
## Adjusted and Calibrated Cox Index
RRratio <- rbind(RRratio,c(RR=RRAnalysisCalAdCox$keyPoints$RR[1],
                           LCI=RRAnalysisCalAdCox$keyPoints$RR_LCI[1],
                           UCI=RRAnalysisCalAdCox$keyPoints$RR_UCI[1]))
rownames(RRratio) <- c("CI","Cox","Adj. Cox","Cal. Adj. Cox")
pander::pander(RRratio)
  RR LCI UCI
CI 3.81 2.08 6.96
Cox 3.81 2.08 6.96
Adj. Cox 3.42 1.93 6.07
Cal. Adj. Cox 3.42 1.93 6.07

Comparing logRank values

## Correlation Index
SurvDif <- c(chisq=RRAnalysisCI$surdif$chisq,pvalue=RRAnalysisCI$surdif$pvalue)
## Cox Index
SurvDif <- rbind(SurvDif,c(chisq=RRAnalysisCox$surdif$chisq,pvalue=RRAnalysisCox$surdif$pvalue))
## Adjusted Cox Index
SurvDif <- rbind(SurvDif,c(chisq=RRAnalysisAdCox$surdif$chisq,pvalue=RRAnalysisAdCox$surdif$pvalue))
## Adjusted and Calibrated Cox Index
SurvDif <- rbind(SurvDif,c(chisq=RRAnalysisCalAdCox$surdif$chisq,pvalue=RRAnalysisCalAdCox$surdif$pvalue))
rownames(SurvDif) <- c("CI","Cox","Adj. Cox","Cal. Adj. Cox")

pander::pander(SurvDif)
  chisq pvalue
CI 28.1 7.97e-07
Cox 28.1 7.97e-07
Adj. Cox 28.5 6.46e-07
Cal. Adj. Cox 28.5 6.46e-07

Comparing Sensitivity

## Correlation Index
sensi <- RRAnalysisCI$ROCAnalysis$sensitivity
## Cox Index
sensi <- rbind(sensi,RRAnalysisCox$ROCAnalysis$sensitivity)
## Adjusted Cox Index
sensi <- rbind(sensi,RRAnalysisAdCox$ROCAnalysis$sensitivity)
## Adjusted and Calibrated Cox Index
sensi <- rbind(sensi,RRAnalysisCalAdCox$ROCAnalysis$sensitivity)
rownames(sensi) <- c("CI","Cox","Adj. Cox","Cal. Adj. Cox")

pander::pander(sensi)
  est lower upper
CI 0.891 0.813 0.944
Cox 0.891 0.813 0.944
Adj. Cox 0.891 0.813 0.944
Cal. Adj. Cox 0.891 0.813 0.944

Comparing Specificity

## Correlation Index
speci <- RRAnalysisCI$ROCAnalysis$specificity
## Cox Index
speci <- rbind(speci,RRAnalysisCox$ROCAnalysis$specificity)
## Adjusted Cox Index
speci <- rbind(speci,RRAnalysisAdCox$ROCAnalysis$specificity)
## Adjusted and Calibrated Cox Index
speci <- rbind(speci,RRAnalysisCalAdCox$ROCAnalysis$specificity)
rownames(speci) <- c("CI","Cox","Adj. Cox","Cal. Adj. Cox")
pander::pander(speci)
  est lower upper
CI 0.397 0.328 0.469
Cox 0.397 0.328 0.469
Adj. Cox 0.397 0.328 0.469
Cal. Adj. Cox 0.397 0.328 0.469

Comparing O/E

OERatio <- NULL
## Cox Index
OERatio <- rbind(OERatio,RRAnalysisCox$OERatio$estimate)
## Adjusted Cox Index
OERatio <- rbind(OERatio,RRAnalysisAdCox$OERatio$estimate)
## Adjusted and Calibrated Cox Index
OERatio <- rbind(OERatio,RRAnalysisCalAdCox$OERatio$estimate)
rownames(OERatio) <- c("Cox","Adj. Cox","Cal. Adj. Cox")

pander::pander(OERatio)
  O/E Low Upper p.value
Cox 0.806 0.656 0.979 0.0285
Adj. Cox 0.825 0.672 1.002 0.0519
Cal. Adj. Cox 0.839 0.683 1.019 0.0831

Comparing O/Acum

OARatio <- NULL
## Cox Index
OARatio <- rbind(OARatio,RRAnalysisCox$OARatio$estimate)
## Adjusted Cox Index
OARatio <- rbind(OARatio,RRAnalysisAdCox$OARatio$estimate)
## Adjusted and Calibrated Cox Index
OARatio <- rbind(OARatio,RRAnalysisCalAdCox$OARatio$estimate)
rownames(OARatio) <- c("Cox","Adj. Cox","Cal. Adj. Cox")
pander::pander(OARatio)
  O/A Low Upper p.value
Cox 1.15 0.936 1.40 0.165
Adj. Cox 1.18 0.961 1.43 0.104
Cal. Adj. Cox 1.01 0.823 1.23 0.920

Comparing NetBenefit

NetBen <- NULL
## Cox Index
NetBen <- rbind(NetBen,RRAnalysisCox$keyPoints$NetBenefit)
## Adjusted Cox Index
NetBen <- rbind(NetBen,RRAnalysisAdCox$keyPoints$NetBenefit)
## Adjusted and Calibrated Cox Index
NetBen <- rbind(NetBen,RRAnalysisCalAdCox$keyPoints$NetBenefit)
colnames(NetBen) <- rownames(RRAnalysisCox$keyPoints)
rownames(NetBen) <- c("Cox","Adj. Cox","Cal. Adj. Cox")
pander::pander(NetBen)
  @:0.9 @:0.95 @MAX_BACC @MAX_RR @SPE100 p(0.5)
Cox 0.223 0.232 0.222 0.239 0.252 -0.02795
Adj. Cox 0.230 0.249 0.202 0.252 0.274 0.00617
Cal. Adj. Cox 0.190 0.211 0.162 0.215 0.239 0.01354

Compare the ROC AUC

pander::pander(pROC::roc.test(RRAnalysisCI$ROCAnalysis$ROC.analysis$roc.predictor,
                              RRAnalysisAdCox$ROCAnalysis$ROC.analysis$roc.predictor))
DeLong’s test for two correlated ROC curves: RRAnalysisCI$ROCAnalysis$ROC.analysis$roc.predictor and RRAnalysisAdCox$ROCAnalysis$ROC.analysis$roc.predictor
Test statistic P value Alternative hypothesis AUC of roc1 AUC of roc2
-0.992 0.321 two.sided 0.692 0.702